<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="DragSource,mx.core.DragSource,formats,addData,addHandler,dataForFormat,hasFormat" name="keywords">
<title>mx.core.DragSource</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'DragSource - Zentrum virtUOS: virtPresenter';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">virtPresenter AsDoc</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?mx/core/DragSource.html&amp;mx/core/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;DragSource</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class DragSource"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">mx.core</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class DragSource</td>
</tr>
</table>
<p></p>
  The DragSource class contains the data being dragged. The data can be in
  multiple formats. For example, a Text component may have plain text,
  rich text and HTML data.
   <p>Each format of data is identified with a string. The 
  <code>hasFormat()</code> method is used to determine if the object has
  data in that format. The <code>dataForFormat()</code> method is used
  to retrieve the data in the specified format.</p>
   <p>Data can be added directly using the <code>addData()</code> method,
  or indirectly using the <code>addHandler()</code> method. The 
  <code>addHandler()</code> method registers a callback that will be called
  if the data is requested. This is useful for adding data in a non-native 
  format that may require large computations or conversions. For example, 
  if you have raw sound data you can add an MP3 format handler. The MP3 
  conversion will only be done if the MP3 data is requested.</p>
  
 <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#formats">formats</a> : Array<div class="summaryTableDescription">[read-only]
   Contains the formats of the drag data, as an Array of Strings.</div>
</td><td class="summaryTableOwnerCol">DragSource</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#DragSource()">DragSource</a>()</div>
<div class="summaryTableDescription">
   Constructor.</div>
</td><td class="summaryTableOwnerCol">DragSource</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addData()">addData</a>(data:Object, format:String):void</div>
<div class="summaryTableDescription">
   Adds data and a corresponding format String to the drag source.</div>
</td><td class="summaryTableOwnerCol">DragSource</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addHandler()">addHandler</a>(handler:Function, format:String):void</div>
<div class="summaryTableDescription">
   Adds a handler that is called when data
   for the specified format is requested.</div>
</td><td class="summaryTableOwnerCol">DragSource</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#dataForFormat()">dataForFormat</a>(format:String):Object</div>
<div class="summaryTableDescription">
   Retrieves the data for the specified format.</div>
</td><td class="summaryTableOwnerCol">DragSource</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#hasFormat()">hasFormat</a>(format:String):Boolean</div>
<div class="summaryTableDescription">
   Returns <code>true</code> if the data source contains
   the requested format; otherwise, it returns <code>false</code>.</div>
</td><td class="summaryTableOwnerCol">DragSource</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="formats"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">formats</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>formats:Array</code>&nbsp;&nbsp;[read-only]<p>
   Contains the formats of the drag data, as an Array of Strings.
   Set this property using the <code>addData()</code>
   or <code>addHandler()</code> methods.
   The default value depends on data added to the DragSource object.
    </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get formats():Array</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="DragSource()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">DragSource</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function DragSource()</code><p>
   Constructor.
  </p></div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="addData()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addData</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function addData(data:Object, format:String):void</code><p>
   Adds data and a corresponding format String to the drag source.
   This method does not return a value.
  
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">data</span>:Object</code> &mdash; Object that specifies the drag data.
   This can be any object, such as a String, a DataProvider, and so on.
     </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">format</span>:String</code> &mdash; String that specifies a label that describes
   the format for this data.
  </td>
</tr>
</table>
</div>
<a name="addHandler()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addHandler</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function addHandler(handler:Function, format:String):void</code><p>
   Adds a handler that is called when data
   for the specified format is requested. 
   This is useful when dragging large amounts of data.
   The handler is only called if the data is requested.
   This method does not return a value.
     </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">handler</span>:Function</code> &mdash; Function that specifies the handler
   called to request the data.
   This function must return the data in the specified format.
     </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">format</span>:String</code> &mdash; String that specifies the format for this data.
  </td>
</tr>
</table>
</div>
<a name="dataForFormat()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">dataForFormat</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function dataForFormat(format:String):Object</code><p>
   Retrieves the data for the specified format.
   If the data was added with the <code>addData()</code> method,
   it is returned directly.
   If the data was added with the <code>addHandler()</code> method,
   the handler function is called to return the data.
     </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">format</span>:String</code> &mdash; String that specifies a label that describes
   the format for the data to return.
     </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Object</code> &mdash; An Object
   containing the data in the requested format.
   If you drag multiple items, the returned value is an Array. 
   For a list control, the returned value is always an Array, 
   even if it contains a single item.
  </td>
</tr>
</table>
</div>
<a name="hasFormat()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">hasFormat</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function hasFormat(format:String):Boolean</code><p>
   Returns <code>true</code> if the data source contains
   the requested format; otherwise, it returns <code>false</code>.
     </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">format</span>:String</code> &mdash; String that specifies a label that describes the format 
   for the data.
     </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Boolean</code> &mdash; <code>true</code> if the data source contains
   the requested format.
  </td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
